//
//  UIGridViewCell.h
//  GridViewUsingTableView
//
//  Created by Manoj Babu on 23/09/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol UIGridViewCellDelegate;
@class UIGridViewCellConnection;

@interface UIGridViewCell : UIView {
    
    id<UIGridViewCellDelegate> delegate;
@private
    UIButton *_button;
    NSInteger _index;
    NSString *_url;
    dispatch_queue_t _imageQueue;   
    UIGridViewCellConnection *_connection;
    NSMutableData *imageData;
}
@property (nonatomic, assign) id<UIGridViewCellDelegate> delegate;

-(void)loadCellAtIndex:(NSInteger)index withURL:(NSString *)url;
-(void)setCellFram:(CGRect)frame;
@end


@protocol UIGridViewCellDelegate <NSObject>

@required
-(void)didSelectCell:(UIGridViewCell *)cell withIndex:(NSInteger)index;

@end

@interface UIGridViewCellConnection : NSURLConnection {
    NSString *url;
}
@property (nonatomic, readonly) NSString *url;
@end